﻿/// <reference path="BaseValidator.js" />

TA.Turbo.Controls.RegexValidator = function RegexValidator(clientId)
{
	this.BaseValidator(clientId);

}
TA.Turbo.Controls.RegexValidator.Inherit(TA.Turbo.Controls.BaseValidator);
var ____a;
if (____a)
{
	TA.Turbo.Controls.RegexValidator.prototype = new TA.Turbo.Controls.BaseValidator();
	TA.Turbo.Controls.RegexValidator.prototype.BaseValidator = new TA.Turbo.Controls.BaseValidator();
}
var $RegexValidator = TA.Turbo.Controls.RegexValidator;

$PropertyDefinition.Define($RegexValidator, "Regex", "R", "");

$RegexValidator.prototype._OnValidate = function _OnValidate()
{
	if (String.IsNullOrEmpty(this.get_Regex()))
		this.set_IsValid(true);
	else
		this.set_IsValid(new RegExp(this.get_Regex()).test(this.get_ValidatedValue()));
}
